<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>

<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>后台添加新闻页面</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!-- 图文混排 -->
		<!-- 设置下拉列表框样式 -->
		<style type="text/css">
.select * {
	margin: 0;
	padding: 0;
}

.select {
	border: 1px solid #cccccc;
	float: left;
	display: inline;
}

.select div {
	border: 1px solid #f9f9f9;
	float: left;
}

/* 子选择器，在FF等非IE浏览器中识别 */
.select>div {
	width: 120px;
	height: 17px;
	overflow: hidden;
}

/* 通配选择符，只在IE浏览器中识别 */
* html .select div select {
	display: block;
	float: left;
	margin: -2px;
}

.select div>select {
	display: block;
	width: 124px;
	float: none;
	margin: -2px;
	padding: 0px;
}

.select:hover {
	border: 1px solid #666666;
}

.select select>option {
	text-indent: 2px;
}
html,body {height:100%; margin:0px; font-size:12px;}
.mydiv {
background-color: #FFCC66;
border: 1px solid #f00;
text-align: left;
line-height: 40px;
font-size: 12px;
font-weight: bold;
z-index:999;
width: 500px;
height: 300px;
left:50%;
top:50%;
margin-left:-150px!important;/*FF IE7 该值为本身宽的一半 */
margin-top:-60px!important;/*FF IE7 该值为本身高的一半*/
margin-top:0px;
position:fixed!important;/* FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
 
}
 
.bg,.popIframe {
background-color: #666; display:none;
width: 100%;
height: 100%;
left:0;
top:0;/*FF IE7*/
filter:alpha(opacity=50);/*IE*/
opacity:0.5;/*FF*/
z-index:1;
position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);
}
.popIframe {
filter:alpha(opacity=0);/*IE*/
opacity:0;/*FF*/
}
-->

</style>
		<link rel="stylesheet" type="text/css" href="../css/style.css">
		<link href="../css/addChance.css" rel="stylesheet" type="text/css">
		<!-- 设置按钮样式 -->
		<link href="../css/Admin.css" rel="stylesheet" type="text/css">
		<!-- 设置文本框样式 -->

		<script type="text/javascript">
	
</script>
<link href="../images/blue/css.css" rel="stylesheet" type="text/css" id="showdialogcss" />
<script src="../js/jquery.js"></script>
<script src="../js/dialog.js"></script>
<SCRIPT type="text/javascript" src="../js/map.js"></SCRIPT>
<script type="text/javascript">
var map=new Map();
var isExists=new Map();
function showDiv(divId){
	document.getElementById('popDiv'+divId).style.display='block';
	document.getElementById('popIframe').style.display='block';
	document.getElementById('bg').style.display='block';
	}
	function closeDiv(divId){
	document.getElementById('popDiv'+divId).style.display='none';
	document.getElementById('bg').style.display='none';
	document.getElementById('popIframe').style.display='none';
	var a=document.getElementsByName("testItem"+divId);
	for(var i=0;i<a.length;i++){
		if(a[i].checked){
			map.put(a[i].value,a[i].title);
			}
	}
	var testItemContent=document.getElementById('testItemContent');
	var content="";
	for (x in map.container)
	  {
		//  if(!isExists.containsKey(x)){
		isExists.put(x,map.get(x));
		 // }
	  }
	for(x in isExists.container){
		content=content+"<input type=\"checkbox\" onclick=\"removeMap(this)\" name=\"testItem\" id=\"testItem"+x+"\" checked=\"checked\" value=\""+x+"\" title=\""+isExists.get(x)+"\"/> <label for=\"testItem"+x+"\">"+isExists.get(x)+"</label><br/>"
	}
	testItemContent.innerHTML=content;
	}



function removeMap(a){
	//alert(isExists.remove(a.value););
	document.getElementById('testItem_'+a.value).checked=!document.getElementById('testItem_'+a.value).checked;
	isExists=isExists.remove(a.value);
	map=map.remove(a.value);
	var testItemContent=document.getElementById('testItemContent');
	var content="";
	for(x in isExists.container){
		content=content+"<input type=\"checkbox\" onclick=\"removeMap(this)\" name=\"testItem\" id=\"testItem"+x+"\" checked=\"checked\" value=\""+x+"\" title=\""+isExists.get(x)+"\"/> <label for=\"testItem"+x+"\">"+isExists.get(x)+"</label><br/>"
	}
	testItemContent.innerHTML=content;
}

function check(){
var prono=document.getElementById('project.prono');
var unitName=document.getElementById('enParty.unitName');
var unitName=document.getElementById('enParty.reportTitle');
}


</script>
<s:head theme="ajax" />  
	</head>

	<body>
		<s:form method="post" 
			action="doAddProjectAction.action" theme="simple">
			<div align="center">
				<h1>
					广州京诚检测技术有限公司
				</h1>
				<h2>
					委 托 检 验 协 议 书 （环境类）
				</h2>
			</div>


			<table align="center" width="780px" border="1" cellpadding="0"
				cellspacing="0" bgcolor="#C0CCDD" id="content">
				<tr>
					<td align="left" colspan="4">
						说明：1. 需要出英文报告的，请详细填写英文单位名称、英文地址、英文样品名称；
						<br />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.
						带有 * 标识的为必填内容。
					</td>
				</tr>
				<tr>
				<td><span class="red" id="dictType">*</span>项目编号：
				</td>
				<td colspan="3"><s:textfield  name="project.prono" id="project.prono"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" /></td>
				</tr>
				<tr>
					<td rowspan="5" width="10%">
						委托单位信息
					</td>
					<td colspan="3">
						<span class="red" id="dictType">*</span>单位名称：
						<s:textfield  name="enParty.unitName"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<span class="red" id="dictType">*</span>报告抬头：
						<s:textfield name="enParty.reportTitle"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<span class="red" id="dictType">*</span>发票抬头：
						<s:textfield  name="enParty.receiptTitle"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<span class="red" id="dictType">*</span>通讯地址（邮政编码）：
						<s:textfield  name="enParty.address"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td>
						&nbsp;E-mail：
						<s:textfield  name="enParty.email"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td width="35%">
						<span class="red" id="dictType">*</span>联&nbsp;系&nbsp;人：
						<s:textfield  name="enParty.contacts"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td width="15%">
						<span class="red" id="dictType">*</span>电话：
						<s:textfield  name="enParty.telephone"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td width="35%">
						&nbsp;传真：
						<s:textfield  name="enParty.fax"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>

				<tr>
					<td rowspan="5">
						样品信息
					</td>
					<td colspan="2">
						<span class="red" id="dictType">*</span>样品名称：
						<s:textfield  name="sample.sampleName"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td>
						<span class="red" id="dictType">*</span>样品数量：<s:select name="sample.sampleNumber" list="#{'1':'1','2':'2','3':'3','4':'4','5':'5','6':'6'}"></s:select>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						&nbsp;样品来源：
						<s:textfield  name="sample.sampleFrom"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td>
						&nbsp;规格：
						<s:textfield  name="sample.sampleFormat"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						&nbsp;样品类别：
						<s:checkboxlist list="sampleTypes"  name="testSampleType" listKey="pid" onclick="javascript:showDiv(this.value)" listValue="sampleType"></s:checkboxlist>
					</td>
				</tr>
				<tr>
					<td colspan="3">
						&nbsp;存放要求：<input type="radio" name="sample.storeType" value="室温 " id="室温"><label for="室温">室温</label>  <input type="radio" name="sample.storeType" value="冷藏" id="冷藏"><label for="冷藏">冷藏</label>  <input type="radio" name="sample.storeType" value="冷冻" id="冷冻"><label for="冷冻">冷冻</label> <input type="radio" name="sample.storeType" value="避光" id="避光"><label for="避光">避光</label>  <input type="radio" name="sample.storeType" id="其他"><label for="其他">其他</label>：
					</td>
				</tr>
				<tr>
					<td colspan="3">
						&nbsp;采样日期及采样时周边环境简单描述：
						<s:textarea  name="sample.description"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" cols="10" rows="10" />
					</td>
				</tr>


				<tr>
					<td rowspan="2">
						委托内容
					</td>
					<td>
						<span class="red" id="dictType">*</span>检验项目：
						<div id="testItemContent"></div>
					</td>
					<td colspan="2">
						<span class="red" id="dictType">*</span>检验依据：
						<s:textfield  name="project.testBase"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						&nbsp;检验目的：
						<s:textfield  name="project.testObjective"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>

				<tr>
					<td rowspan="2">
						报告交付
					</td>
					<td colspan="3">
						<span class="red" id="dictType">*</span>交付方式
						<s:textfield  name="project.delivery"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td>
					<span class="red" id="dictType">*</span>报告份数&nbsp;&nbsp;<s:select name="project.reportCopies" list="#{'1':'1','2':'2','3':'3','4':'4','5':'5','6':'6'}"></s:select>
					</td>
					<td colspan="2">
						&nbsp;交付日期&nbsp;&nbsp;<s:datetimepicker name="project.deliveryDate" displayFormat="yyyy-MM-dd"></s:datetimepicker>
					</td>
				</tr>
				<tr>
					<td>
						样品处理
					</td>
					<td colspan="3">
					<input type="radio" name="project.sampleHandling" value="领回 " id="领回 "><label for="领回 ">领回</label>     <input type="radio" name="project.sampleHandling"  value="处置" id="处置"><label for="处置">处置</label>     <input type="radio" name="project.sampleHandling" id="领取报告后"><label for="领取报告后">领取报告后，继续保管</label><s:select list="#{'1':'1','2':'2'}"></s:select>个月
					</td>
				</tr>
				<tr>
					<td rowspan="2">
						检测费用
					</td>
					<td>
						<span class="red" id="dictType">*</span>检测费（元）
						<s:textfield  name="project.inspectionFees"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td colspan="2">
						&nbsp;加急费（元）
						<s:textfield  name="project.surCharge"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td>
						<span class="red" id="dictType">*</span>合&nbsp;&nbsp;计（元）
						<s:textfield  name="project.totalFee"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
					<td colspan="2">
						&nbsp;预收费（元）
						<s:textfield  name="project.advanceFee"
							cssStyle="width:60%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>
				<tr>
					<td>
						备注
					</td>
					<td colspan="3">
						&nbsp;<s:textfield  name="project.remark"
							cssStyle="width:80%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
					</td>
				</tr>

				<tr>
					<td colspan="2">
						<span class="red" id="dictType">*</span>委托人签字：
						<s:textfield  name="project.principal"
							cssStyle="width:50%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" /><br>
							<div align="right">
							<s:datetimepicker name="project.PrincipalDate" displayFormat="yyyy-MM-dd"></s:datetimepicker>
							</div>
							
					</td>
					<td colspan="2">
						<span class="red" id="dictType">*</span>受理人签字：
						<s:textfield  name="project.acceptancePerson"
							cssStyle="width:50%" cssClass="FormBase"
							onfocus="this.className='FormFocus';"
							onblur="this.className='FormBase';" />
							<div align="right">
							<s:datetimepicker name="project.acceptanceDate" displayFormat="yyyy-MM-dd"></s:datetimepicker>
							</div>
					</td>
				</tr>
			</table>
			<div align="center">
				地址：广州市番禺节能科技园天安科技创新大厦413(511400) 网址：<a href="http://www.beijingtest.com" target="_blank">http://www.beijingtest.com</a>
				<br />
				联系电话：（020）39211288 传真：（020）39211233 E-mail：<a href="mailto:cs@beijingtest.com">cs@beijingtest.com</a> 业务员：
				<s:textfield  name="project.salesMan"
					cssClass="FormBase" onfocus="this.className='FormFocus';"
					onblur="this.className='FormBase';" /><br/>
					<s:submit cssStyle="width:100px" value="提交"></s:submit > <s:reset cssStyle="width:100px" value="重置"></s:reset>
			</div>
			
			<s:iterator id="ss" value="sampleTypes">
			<div id="popDiv<s:property value="pid"/>" class="mydiv" style="display:none;"><s:property value="#ss.sampleType"/>相关检测项目<br/>
			<s:iterator value="#ss.testItems">
			
			<input type="checkbox"  name="testItem<s:property value="#ss.pid"/>" id="testItem_<s:property value="pid"/>" value="<s:property value="pid"/>" title="<s:property value="monitorProject"/>"/>
						<label for="testItem_<s:property value="pid"/>"><s:property value="monitorProject"/></label>
			</s:iterator><br/>
			<div align="center"><a href="javascript:closeDiv(<s:property value="pid"/>)">确认提交</a></div></div>
			</s:iterator>
<div id="bg" class="bg" style="display:none;"></div>
<iframe id='popIframe' class='popIframe' frameborder='0' ></iframe>
		</s:form>
	</body>
</html>
